# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=toot
pkgver=0.45.0
pkgrel=0
pkgdesc="mastodon cli & tui"
url="https://github.com/ihabunek/toot"
arch="noarch"
license="GPL-3.0-only"
depends="
	py3-beautifulsoup4
	py3-click
	py3-pillow
	py3-requests
	py3-term-image
	py3-tomlkit
	py3-urwid
	py3-urwidgets
	py3-wcwidth
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/t/toot/toot-$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# Integration tests require a running Mastodon instance.
	.testenv/bin/python3 -m pytest --ignore=tests/integration/
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c45d81e234657f5d057e9416525fa43a7dc29a111f3c07f5afdc728487e4c6a45a143014dc98ff4f9d22992045d69fdad87e8fc697f7e66ee71f865639c994a4  toot-0.45.0.tar.gz
"
